<?php 
/**
 * Parses time in seconds to time
 * 
 * For example 100 seconds is parsed into 1:10
 * $params can have one argument - time
 *
 * @param Array $params
 * @param Smarty $smarty
 * @return String
 */
function smarty_function_sec2time($params, &$smarty) {
	if( $params["time"] > 0) {
		$a = floor($params["time"]/60);
		$b = ($params["time"]%60);
		if( $b < 10) 
			$b = '0'.$b;
		return $a . ':' . $b;
	} else {
		return '0:00';
	}
}
?>